import App from './App'
import uviewPlus from 'uview-plus'
import zh from './locale/zh.json'
import en from './locale/en.json'

// 这个决定着语言包以及对应的标识，还决定着使用那个语言包

const curLan = uni.getStorageSync('lan')
const i18nConfig = {
	messages: {
		'zh': zh,
		'en': en,
	},
	locale: curLan || 'en'
	
}
// #ifndef VUE3
import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
  ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import { createI18n } from 'vue-i18n'
const i18n = createI18n(i18nConfig)
export function createApp() {
  const app = createSSRApp(App)
  app.use(uviewPlus)
  app.use(i18n)
  return {
    app
  }
}
// #endif